package com.chushouya.order.constants;


import com.general.framework.core.enums.IEnum;
import com.general.framework.core.exception.Ex;

import java.util.Objects;

public enum ClerkOrderTodoStatusEnum implements IEnum<Integer> {

    waitAccept(1, "等待接单"),
    waitVisit(2, "今日预约"),
    waitDeliver(3, "等待发货");

    private Integer value;

    private String desc;

    ClerkOrderTodoStatusEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static ClerkOrderTodoStatusEnum get(Integer value) {
        for (ClerkOrderTodoStatusEnum thisEnum : ClerkOrderTodoStatusEnum.values()) {
            if (Objects.equals(thisEnum.value, value)) {
                return thisEnum;
            }
        }
        throw Ex.systemError("未定义的枚举[{}]", value);
    }


    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
